import { useModel } from "umi";
import { useReactive } from "ahooks";
import { useEffect } from "react";

const usePayMerchant = () => {
    const { remoteData } = useModel("global");

    const state = useReactive({
        dataLoading: false,
        submitLoading: false,
        payMerchants: [],
    });

    const loadPayMerchants = async (oiUuid) => {
        state.dataLoading = true;
        // let res = await remoteData({
        //     object: "bnt-application-operation-center-service",
        //     serviceName: "/servicer/organization/getCustomers",
        //     params: { oiUuid },
        // });
        // state.payMerchants = res || [];
        state.dataLoading = false;
    };

    const savePayMerchant = async () => {
        state.submitLoading = true;
        state.submitLoading = false;
    };

    const updatePayMerchant = async () => {
        state.submitLoading = true;
        state.submitLoading = false;
    };

    const deletePayMerchant = async () => {
        state.submitLoading = true;
        state.submitLoading = false;
    };

    return { ...state, loadPayMerchants, savePayMerchant, updatePayMerchant, deletePayMerchant };
};

export default usePayMerchant;
